import time
import mujoco
from os.path import dirname, join

# 加载模型
model = mujoco.MjModel.from_xml_path(join(dirname(__file__),'tippe_top.xml')) 
data = mujoco.MjData(model)

duration = 10
framerate = 60
frames = []

mujoco.mj_resetDataKeyframe(model, data, 0) # 激活keyframe初始状态

with mujoco.viewer.launch_passive(model, data) as viewer:
    start = time.time()
    while viewer.is_running() and data.time < duration:
        mujoco.mj_step(model, data)
        viewer.sync()